package cn.oowoo.sentinelclusterclient.service;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.stereotype.Service;

@Service
public class TestService {

    @SentinelResource(value = "sentinelAloneTest",blockHandler = "sentinelAloneErrHandler")
    public String sentinelAloneTest() {
        return "sentinel-alone-test";
    }

    public String sentinelAloneErrHandler(BlockException e){
        e.printStackTrace();
        return "服务限流/降级";
    }
}
